﻿@{
    ViewBag.Title = "StockInventory";
    Layout = "~/Views/Shared/_Index.cshtml";
}

<input hidden id="yfbmcode" value="@ViewBag.bmCode">
<input hidden id="OrganizeId" value="@ViewBag.OrganizeId">
<style>
    .dv-panel {
        width: 100%;
        position: fixed;
        height: 100%;
    }

    #btn_search {
        width: 50px;
        margin-left: 40px;
    }

    .dv-index {
        position: absolute;
        top: 50%;
        left: 50%;
        margin-left: -230px;
        margin-top: -50px;
    }

        .dv-index div {
            float: left;
            width: 200px;
            height: 50px;
            background-color: #00a0ea;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            line-height: 50px;
            text-align: center;
            font-size: 18px;
            font-weight: bold;
            color: white;
            margin-right: 30px;
            cursor: pointer;
            -webkit-box-shadow: #666 3px 4px 8px;
            -moz-box-shadow: #666 3px 4px 8px;
            box-shadow: #666 3px 4px 8px;
        }

    .dv-content-step {
        width: 100%;
        display: none;
    }

    .dv-navigation {
        height: 45px;
        margin-bottom: 5px;
    }

    .dv-backIndex {
        float: left;
        line-height: 45px;
        margin-left: 10px;
    }

    .progress_bar {
        margin-left: 100px;
        padding: 10px 0 10px;
    }

        .progress_bar li {
            width: 180px;
            float: left;
            text-align: center;
            position: relative;
            line-height: 30px;
            list-style: none;
            border-top: 6px solid #f5f5f5;
        }

            .progress_bar li i {
                position: absolute;
                left: 50%;
                margin-left: -10px;
                top: -14px;
                height: 18px;
                width: 18px;
                border: 2px solid white;
                border-radius: 10px;
                background-color: #f5f5f5;
            }

        .progress_bar .completeLi {
            color: #ff9813;
            border-top-color: #ff9813;
        }

        .progress_bar .completePoint {
            background-color: #ff9813;
        }

    .dv-SearchHistory {
        overflow-x: auto;
        display: none;
    }

    .dv-pd {
        overflow-x: auto;
        display: none;
    }

    .dv-pd-btn {
        display: none;
    }

    .form-control {
        padding: 0 3px;
    }
</style>
<div class="dv-panel">
    <div class="dv-index">
        <div id="dv_index_startPd">开始盘点</div>
        <div id="dv_search">查询</div>
    </div>
    <div class="dv-content-step">
        <div class="panel panel-default dv-navigation">
            <div class="dv-backIndex"><input type="button" id="btn_backIndex" class="btn btn-primary" value="返回首页" /></div>
            <ol class="progress_bar">
                <li id="dv_startPd"><i></i><label>开始盘点</label></li>
                <li id="dv_savePd"><i></i><label>保存</label></li>
                <li id="dv_endPd"><i></i><label>结束盘点</label></li>
                <li id="dv_completePd"><i></i><label>完成</label></li>
            </ol>
        </div>
        <div class="panel panel-default" style="margin-bottom:5px;">
            <div class="panel-heading">
                查询条件
            </div>
            <table class="form">
                <tr>
                    <th class="formTitle" style="width: 70px;">日期：</th>
                    <td class="formValue" colspan="2">
                        <select id="ddlRQ" class="form-control"></select>
                    </td>
                    <th class="formTitle">关键字：</th>
                    <td class="formValue" style="width: 115px;">
                        <input id="txtSRM" type="text" class="form-control" placeholder="拼音 药品名称" />
                    </td>
                    <th class="formTitle">药品状态：</th>
                    <td class="formValue" style="width: 55px;">
                        <select id="ddlYPZT" name="ddlYPZT" class="form-control">
                            <option value="-1">全部</option>
                            <option value="1">启用</option>
                            <option value="0">停用</option>
                        </select>
                    </td>
                    <th class="formTitle" style="display:none">药品类别：</th>
                    <td class="formValue" style="display:none">
                        <select id="ddlYPLB" class="form-control">
                            <option value="">全部</option>
                        </select>
                    </td>
                    <th class="formTitle">库存显示：</th>
                    <td class="formValue">
                        <select id="ddlKCXS" name="ddlKCXS" class="form-control">
                            <option value="-1">全部</option>
                            <option value="0">显示零库存</option>
                            <option value="1">不显示理论数量为零</option>
                            <option value="2">不显示实际数量为零</option>
                            <option value="4">不显示两者都为零</option>
                        </select>
                    </td>
                    <td class="formValue">
                        <input type="button" id="btn_search" class="btn btn-primary" value="查询" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="dv-SearchHistory">
            <table id="gridKCInfoHistory"></table>
            <div id="gridPagerHistory" rel="form1"></div>

        </div>
        <div class="dv-pd">
            <table id="gridKCInfo"></table>
            <div id="gridPager" rel="form1"></div>

        </div>
        <div id="button_1" class="dv-pd-btn">
            @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
       {
           ShowKeyList = new[] { 8, 3, 7, },
           //F2Text = "开始",
           F3Text = "结束",
           F7Text = "取消"
       })
        </div>
        <div id="button_2" class="dv-pd-btn">
            @Html.Partial("_BottomButtonsView", new Newtouch.HIS.Web.Core.Models.BottomButtonViewModel
       {
           ShowKeyList = new[] { 10, 6, 9, },
           F10Text = "大类明细",
           F6Text = "剂型明细",
           F9Text = "盘点明细"
       })
        </div>
    </div>
</div>

<script>
    var $gridKCInfo = $("#gridKCInfo");
    var $gridKCInfoHistory = $("#gridKCInfoHistory");
    var lastRowId;
    var ObjArr_Load = new Array();
    var searchType = 0;//0:历史查询 1：开始盘点
    $(function () {
        $(window).resize(function () {//浏览器窗口调整大小时重新加载jqGrid的宽
            window.initLayout("MyTabGrid");
        });
        InitialPd();
        $("#btn_search").click(function () {//绑定查询查询
            Search();
        });

        $("#dv_search").click(function () {//查看历史
            $(".dv-content-step").show();
            $(".dv-index").hide();
            $(".dv-pd").hide();
            $("#button_1").hide();
            $("#button_2").show();
            $(".dv-SearchHistory").show();
            searchType = 0;
            Search();
        });
        $("#dv_index_startPd").click(function () {//开始盘点
            $(".dv-content-step").show();
            $(".dv-index").hide();
            $(".dv-pd").show();
            $("#button_1").show();
            $("#button_2").hide();
            $(".dv-SearchHistory").hide();
            searchType = 1;
            newtouch_event_f2();
        });
        $("#btn_backIndex").click(function () {//返回
            $(".dv-content-step").hide();
            $(".dv-index").show();
            searchType = 0;
        });

    });

    //初始化盘点
    function InitialPd() {
        GetPDSJ();//获取盘点日期
        gridKCInfoHistory();
        gridKCInfo();
    }

    //库存信息
    function gridKCInfo() {
        $gridKCInfo.dataGrid({
            caption: "药品盘点信息（<lable style='color:#ff0000;'>(实)部门数：实际部门单位数；(实)最小数：实际最小单位数！请将部门数与最小数组合使用</lable>）",
            postData: getSearchPostData(),
            height: $(window).height() - 270,
            url: "",
            editurl: "clientArray",  //行编辑不向服务器提交数据
            colModel: [
                { label: '药品名称', name: 'ypmc', width: 120, align: 'left' },
                { label: '规格', name: 'ypgg', width: 80, align: 'left' },
                { label: '理论数', name: 'llsl', width: 80, align: 'left' },
                { label: '(实)部门数', name: 'deptSjsl', width: 70, align: 'center', editable: true, editwidth: "90%" },
                { label: '单位', name: 'deptdw', width: 40, align: 'left' },
                { label: '(实)最小数', name: 'minSjsl', width: 70, align: 'center', editable: true, editwidth: "90%" },
                { label: '单位', name: 'zxdw', width: 40, align: 'left' },
                { label: '系数', name: 'zhyz', width: 40, align: 'left' },
                { label: '批号', name: 'ph', width: 100, align: 'center' },
                { label: '批次', name: 'pc', width: 100, align: 'left' },
                { label: '有效期', name: 'yxq', width: 80, align: 'left' },
                { label: '批发价', name: 'pfj', width: 60, align: 'left' },
                { label: '零售价', name: 'lsj', width: 60, align: 'left' },
                { label: '批发金额(理)', name: 'llpfje', width: 70, align: 'left' },
                { label: '零售金额(理)', name: 'lllsje', width: 70, align: 'left' },
                { label: '批发金额(实)', name: 'sjpfje', width: 70, align: 'left' },
                { label: '零售金额(实)', name: 'sjlsje', width: 70, align: 'left' },
                { label: '产地', name: 'ycmc', width: 120, align: 'left' },
                { label: '拼音', name: 'py', width: 100, align: 'left' },
                { label: 'pdmxId', name: 'pdmxId', hidden: true },
                { label: '理论数', name: 'llsl_zxbz', hidden: true },
                { label: '药品代码', name: 'ypCode', hidden: true },
                { label: '实际数量(部门包装)', name: 'sjslstr', hidden: true },
                { label: 'CreateTime', name: 'CreateTime', hidden: true }
            ],
            multiselect: false,
            pager: "#gridPager",
            sortname: 'CreateTime desc',
            sortable: true,
            viewrecords: true,
            gridComplete: function () {
                afterCompleteFunction();
                window.initLayout("MyTabGrid");
            },
            onSelectRow: function (rowid) {
                $("#" + $.jgrid.jqID(rowid) + "_sjsl").focus();
            },
            onSelectRow_page: function (rowid) {
                if (rowid && lastRowId && rowid !== lastRowId) {   //&&: 相当于true/fase(判断是否有值)
                    $gridKCInfo.saveRow(lastRowId, null, null, null, function (callbackRowId) {//先保存处于编辑状态的那一行
                        GetYfbmYpComplexYpSlandDw(callbackRowId);//变更当前部门单位下的数量
                    }, null, null);
                }
                lastRowId = rowid;
                $gridKCInfo.jqGrid('editRow', rowid, true, null, null, null, null, function (callbackRowId) {
                    GetYfbmYpComplexYpSlandDw(callbackRowId);//变更当前部门单位下的数量
                    lastRowId = undefined;  //回调
                });
            }
        });
    }

    //库存信息查询
    function gridKCInfoHistory() {
        $gridKCInfoHistory.dataGrid({
            caption: "历史盘点信息",
            postData: getSearchPostData(),
            height: $(window).height() - 270,
            url: "",
            editurl: "clientArray",  //行编辑不向服务器提交数据
            colModel: [
                { label: '药品名称', name: 'ypmc', width: 120, align: 'left' },
                { label: '规格', name: 'ypgg', width: 70, align: 'left' },
                { label: '理论数', name: 'llsl', width: 70, align: 'left' },
                { label: '实际数', name: 'sjslstr', width: 70, align: 'left' },
                { label: '批号', name: 'ph', width: 100, align: 'center' },
                { label: '批次', name: 'pc', width: 100, align: 'left' },
                { label: '有效期', name: 'yxq', width: 80, align: 'left' },
                { label: '批发价', name: 'pfj', width: 60, align: 'left' },
                { label: '零售价', name: 'lsj', width: 60, align: 'left' },
                { label: '批发金额(理)', name: 'llpfje', width: 70, align: 'left' },
                { label: '零售金额(理)', name: 'lllsje', width: 70, align: 'left' },
                { label: '批发金额(实)', name: 'sjpfje', width: 70, align: 'left' },
                { label: '零售金额(实)', name: 'sjlsje', width: 70, align: 'left' },
                { label: '单位', name: 'deptdw', width: 50, align: 'left' },
                { label: '产地', name: 'ycmc', width: 120, align: 'left' },
                { label: '拼音', name: 'py', width: 100, align: 'left' },
                { label: '数量', name: 'deptSjsl', hidden: true },
                { label: '理论数', name: 'llsl_zxbz', hidden: true },
                { label: 'pdmxId', name: 'pdmxId', hidden: true },
                { label: 'zhyz', name: 'zhyz', hidden: true },
                { label: '药品代码', name: 'ypCode', hidden: true },
                { label: '实际数量(部门包装)', name: 'sjslstr', hidden: true },
                { label: '实际数量(最小单位)', name: 'minSjsl', hidden: true },
                { label: '最小单位', name: 'zxdw', hidden: true },
                { label: 'CreateTime', name: 'CreateTime', hidden: true }
            ],
            gridComplete: function () {
                window.initLayout("MyTabGrid");
            },
            multiselect: false,
            pager: "#gridPagerHistory",
            sortname: 'CreateTime desc',
            viewrecords: true
        });
    }

    //查询
    function Search() {
        if (searchType === 0) {
            $gridKCInfoHistory.jqGrid('setGridParam',
                {
                    url: "/PharmacyDrugStorage/SelectInventoryInfoList?r=" + Math.random(),
                    postData: getSearchPostData()
                }).trigger('reloadGrid');
            $.UpdateProgressbar.clean();
        } else {
            $gridKCInfo.jqGrid('setGridParam',
                {
                    url: "/PharmacyDrugStorage/SelectInventoryInfoList?r=" + Math.random(),
                    postData: getSearchPostData()
                }).trigger('reloadGrid');
        }
    }

    //查询条件
    function getSearchPostData() {
        var pdsj = $("#ddlRQ").val();
        var pdId = $("#ddlRQ option:selected").attr('data-pdId');
        var srm = $("#txtSRM").val();
        var ypzt = $("#ddlYPZT").val();
        var kcxs = $("#ddlKCXS").val();
        if (!pdsj && !pdId) {
            return false;
        }
        if (kcxs === "" || kcxs == null) {
            kcxs = -1;
        }
        return { pdsj: pdsj, pdId: pdId, srm: srm, ypzt: ypzt, yplb: "", kcxs: kcxs };
    };

    //加载第一次查询数据
    function afterCompleteFunction() {
        var rowIds = $("#gridKCInfo").jqGrid('getDataIDs');//Grid加载完成开启行内编辑   1.先获取所有行Id  2.遍历调用editRow方法
        for (var i = 0; i < rowIds.length; i++) {
            ObjArr_Load.push($("#gridKCInfo").jqGrid('getRowData', rowIds[i]));
            $("#gridKCInfo").jqGrid('editRow', rowIds[i], true, null, null, null, null, function (callbackRowId) {     //true: when set to true we can use [Enter] key to save the row and [Esc] to cancel editing.
            });
        }
    }

    //获取盘点时间
    function GetPDSJ() {
        $.najax({
            type: "GET",
            url: "/PharmacyDrugStorage/GetPDDateDropdownList",
            dataType: "json",
            success: function (ajaxresp) {
                //先清空，再填充
                $("#ddlRQ").empty();
                for (var i = 0; i < ajaxresp.data.length; i++) {
                    $("#ddlRQ").append('<option data-pdId=' + ajaxresp.data[i].pdId + '>' + ajaxresp.data[i].pdsj + '</option>');
                }
            }
        });

    }

    //输入最小单位下的数量，变更当前部门单位下的数量
    function GetYfbmYpComplexYpSlandDw(callbackRowId) {
        var rowData = $("#gridKCInfo").jqGrid('getRowData', callbackRowId);
        $.najax({
            type: "POST",
            url: "/PharmacyDrugStorage/GetYfbmYpComplexYpSlandDw",
            dataType: "json",
            data: { sl: rowData.sjsl, ypCode: rowData.ypCode },
            success: function (ajaxresp) {
                $('#gridKCInfo').jqGrid('setCell', callbackRowId, 'sjslstr', ajaxresp);
            }
        });
    }

    //开始盘点
    function newtouch_event_f2() {
        $.najax({
            type: "POST",
            url: "/PharmacyDrugStorage/StartInventory",
            dataType: "json",
            success: function (ajaxresp) {
                if (ajaxresp != null && ajaxresp.data != null) {
                    $("#ddlRQ").append('<option data-pdId=' + ajaxresp.data.pdId + ' selected="selected">' + ajaxresp.data.pdsj + '</option>');
                }
                Search();
                $.UpdateProgressbar.update(1);
            }
        });
    }

    //保存
    function newtouch_event_f8() {
        var rowIds = $("#gridKCInfo").jqGrid('getDataIDs');//获取所有行Id，遍历使编辑框处于保存状态
        //判断退数量
        for (var i = 0; i < rowIds.length; i++) {
            $("#gridKCInfo").saveRow(rowIds[i], null, null, null, function (callbackRowId) { }, null, null);
            var rowData = $("#gridKCInfo").jqGrid('getRowData', rowIds[i]);
            if (!rowData) {
                return false;
            }
            if ((rowData.deptSjsl.replace(/(^\s*)|(\s*$)/g, "") === "" && rowData.minSjsl.replace(/(^\s*)|(\s*$)/g, "") === "") ||
                (rowData.deptSjsl < 0 && rowData.minSjsl < 0) ||
                (isNaN(rowData.deptSjsl) && isNaN(rowData.minSjsl)) ||
                (rowData.deptSjsl === "" && rowData.minSjsl === "")) {
                $.modalAlert("项目（" + rowData.ypmc + "）实际数量应为自然数，请确认。", "warning");
                EnableInlineEditBox();//启用行内编辑框
                return false;
            }
        }
        var kcInfoJsonSave = $("#gridKCInfo").jqGrid('getRowData_AllLine');
        var objArrSave = new Array();
        $.each(kcInfoJsonSave, function () {//保存时将Grid的数据行放在新的数组中
            objArrSave.push(this);
        });
        var resultObjArr = new Array();
        //与页面加载的数组进行比对，将修改过的数据行放在resultObjArr中，传给后台
        for (var i = 0; i < objArrSave.length; i++) {
            if (objArrSave[i].deptSjsl !== ObjArr_Load[i].deptSjsl || objArrSave[i].minSjsl !== ObjArr_Load[i].minSjsl) {
                resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNum(objArrSave[i].deptSjsl, objArrSave[i].minSjsl, objArrSave[i].zhyz) });
                //resultObjArr.push({ pdmxId: objArrSave[i].pdmxId, sjsl: CalculationMinUnitNumNoOpen(objArrSave[i].deptSjsl, objArrSave[i].zhyz) });
            }
        }
        if (resultObjArr.length === 0) {
            $.modalAlert("没有需要保存的数据", 'warning');
            $("#btn_search").trigger("click");
            $.UpdateProgressbar.update(2);
            return false;
        }
        $.najax({
            type: "POST",
            url: "/PharmacyDrugStorage/SaveInventoryInfo",
            dataType: "json",
            data: { resultObjArr: JSON.stringify(resultObjArr), pdId: $("#ddlRQ option:selected").attr('data-pdId') },
            success: function (ajaxresp) {
                $.modalAlert("保存成功", 'success');
                $("#btn_search").trigger("click");
                $.UpdateProgressbar.update(2);
            },
            error: function (ajaxresp) {
                $.modalAlert(ajaxresp.message, Error);
            }
        });
    }

    //将库存换算成最小单位数  拆零
    function CalculationMinUnitNum(deptNum, minNum, zhyz) {
        return parseInt(deptNum) * parseInt(zhyz) + parseInt(minNum);
    }

    //将库存换算成最小单位数  不拆零
    function CalculationMinUnitNumNoOpen(deptNum, zhyz) {
        return parseInt(deptNum) * parseInt(zhyz);
    }

    //启用行内编辑框
    function EnableInlineEditBox() {
        var rowIds = $("#gridKCInfo").jqGrid('getDataIDs');//Grid加载完成开启行内编辑   1.先获取所有行Id  2.遍历调用editRow方法
        for (var i = 0; i < rowIds.length; i++) {
            $("#gridKCInfo").jqGrid('editRow', rowIds[i], true, null, null, null, null, function (callbackRowId) {     //true: when set to true we can use [Enter] key to save the row and [Esc] to cancel editing.
            });
        }
    }

    //结束盘点
    function newtouch_event_f3() {
        $.najax({
            type: "POST",
            url: "/PharmacyDrugStorage/EndInventory",
            dataType: "json",
            data: { pdId: $("#ddlRQ option:selected").attr('data-pdId') },
            success: function (ajaxresp) {
                $.modalAlert("盘点完成", 'success');
                GetPDSJ();//刷新盘点时间及药品信息
                $.UpdateProgressbar.update(4);
            },
            error: function (ajaxresp) {
                $.modalAlert(ajaxresp.message, Error);
            }
        });
    }

    //取消盘点
    function newtouch_event_f7() {
        $.najax({
            type: "POST",
            url: "/PharmacyDrugStorage/CancelInventory",
            dataType: "json",
            data: { pdId: $("#ddlRQ option:selected").attr('data-pdId') },
            success: function (ajaxresp) {
                $.modalAlert("取消成功", 'success');
                GetPDSJ();
            }
        });
    }

    //大类明细打印
    function newtouch_event_f10() {
        var srm = $("#txtSRM").val();
        var ypzt = $("#ddlYPZT").val();
        var kcxs = $("#ddlKCXS").val();
        var pdId = $("#ddlRQ option:selected").attr('data-pdId');
        var yfbm = $("#yfbmcode").val();
        var OrganizeId = $("#OrganizeId").val();
        window.open("/Report/PrintReport?type=StockInventoryDl&param=srm=" + srm + "|ypzt=" + ypzt + "|kcxs=" + kcxs + "|pdId=" + pdId + "|yfbm=" + yfbm + "|OrganizeId=" + OrganizeId, "height=500, width=1195, top=100, left=50, toolbar=no, menubar=no, scrollbar=yes, resizeble=no, location=no, status=no");
    }

    //剂型明细打印
    function newtouch_event_f6() {
        var srm = $("#txtSRM").val();
        var ypzt = $("#ddlYPZT").val();
        var kcxs = $("#ddlKCXS").val();
        var pdId = $("#ddlRQ option:selected").attr('data-pdId');
        var yfbm = $("#yfbmcode").val();
        var OrganizeId = $("#OrganizeId").val();
        window.open("/Report/PrintReport?type=StockInventoryJx&param=srm=" + srm + "|ypzt=" + ypzt + "|kcxs=" + kcxs + "|pdId=" + pdId + "|yfbm=" + yfbm + "|OrganizeId=" + OrganizeId, "height=500, width=1195, top=100, left=50, toolbar=no, menubar=no, scrollbar=yes, resizeble=no, location=no, status=no");
    }

    //盘点明细打印
    function newtouch_event_f9() {
        var srm = $("#txtSRM").val();
        var ypzt = $("#ddlYPZT").val();
        var kcxs = $("#ddlKCXS").val();
        var pdId = $("#ddlRQ option:selected").attr('data-pdId');
        var yfbm = $("#yfbmcode").val();
        var OrganizeId = $("#OrganizeId").val();
        window.open("/Report/PrintReport?type=StockInventory&param=srm=" + srm + "|ypzt=" + ypzt + "|kcxs=" + kcxs + "|pdId=" + pdId + "|yfbm=" + yfbm + "|OrganizeId=" + OrganizeId, "height=500, width=1195, top=100, left=50, toolbar=no, menubar=no, scrollbar=yes, resizeble=no, location=no, status=no");
    }

    //进度调更新
    $.UpdateProgressbar = {
        startPd: function () {
            if (!$("#dv_startPd").hasClass("completeLi")) {
                $("#dv_startPd").addClass("completeLi");
            }
            if (!$("#dv_startPd").find("i").hasClass("completePoint")) {
                $("#dv_startPd").find("i").addClass("completePoint");
            }
        },
        savePd: function () {
            if (!$("#dv_savePd").hasClass("completeLi")) {
                $("#dv_savePd").addClass("completeLi");
            }
            if (!$("#dv_savePd").find("i").hasClass("completePoint")) {
                $("#dv_savePd").find("i").addClass("completePoint");
            }
        },
        endPd: function () {
            if (!$("#dv_endPd").hasClass("completeLi")) {
                $("#dv_endPd").addClass("completeLi");
            }
            if (!$("#dv_endPd").find("i").hasClass("completePoint")) {
                $("#dv_endPd").find("i").addClass("completePoint");
            }
        },
        completePd: function () {
            if (!$("#dv_completePd").hasClass("completeLi")) {
                $("#dv_completePd").addClass("completeLi");
            }
            if (!$("#dv_completePd").find("i").hasClass("completePoint")) {
                $("#dv_completePd").find("i").addClass("completePoint");
            }
        },
        update: function (step) {
            switch (step) {
                case 1:
                    $.UpdateProgressbar.startPd();
                    break;
                case 2:
                    $.UpdateProgressbar.startPd();
                    $.UpdateProgressbar.savePd();
                    break;
                case 3:
                    $.UpdateProgressbar.startPd();
                    $.UpdateProgressbar.savePd();
                    $.UpdateProgressbar.endPd();
                    break;
                case 4:
                    $.UpdateProgressbar.startPd();
                    $.UpdateProgressbar.savePd();
                    $.UpdateProgressbar.endPd();
                    $.UpdateProgressbar.completePd();
                    break;
            }
        },
        clean: function () {//初始化进度条 归零
            $("li").removeClass("completeLi");
            $("i").removeClass("completePoint");
        }
    };
</script>
